<form name="formAddUsage" class="form-horizontal" ng-submit="execute()">
	<div class="panel panel-default">
		<div class="panel-heading" translate="payment.usageTitle">
		</div>
		<div class="panel-body">
			<div class="form-group">
				<label class="col-sm-4 control-label" translate="payment.date"></label>
				<div class="col-sm-8">
					<input class="form-control" type="date" required ng-model="addUsage.date"
						   min="{{minDate}}"/>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-4 control-label" translate="payment.machine"></label>
				<div class="col-sm-8">
					<select class="form-control"
							required
							ng-model="addUsage.machine"
							ng-options="m as m.name group by m.machineType.name for m in machines"></select>
				</div>
			</div>

			<div class="form-group" ng-if="unit=='HOUR'">
				<label class="col-sm-4 control-label" translate="payment.time"></label>
				<div class="col-sm-8">
					<input class="form-control" type="time" step="60" required ng-model="addUsage.time"/>
				</div>
			</div>
			<div class="form-group" ng-if="unit=='GRAMME'">
				<label class="col-sm-4 control-label" translate="payment.gramme"></label>
				<div class="col-sm-8">
					<input class="form-control" type="number" step="1" required ng-model="addUsage.amount"/>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-4 control-label" translate="payment.additionalCost"></label>
				<div class="col-sm-8">
					<div class="input-group">
						<input class="form-control" type="number" step="0.05" required
							   ng-model="addUsage.additionalCost"/>
						<div class="input-group-addon">{{currency}}</div>
					</div>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-4 control-label" translate="payment.comment"></label>
				<div class="col-sm-8">
					<textarea class="form-control" ng-model="addUsage.comment"></textarea>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-4 control-label" translate="payment.total"></label>
				<div class="col-sm-8">
					<div class="input-group">
						<input class="form-control" type="number" disabled ng-model="addUsage.total"/>
						<div class="input-group-addon">{{currency}}</div>
					</div>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-4 control-label" translate="payment.directPaid"></label>
				<div class="col-sm-8">
					<select class="form-control" ng-model="addUsage.directPaid" required
							ng-options="o.value as o.label for o in paidDirectlyOptions">
					</select>
				</div>
			</div>
		</div>
		<div class="panel-footer text-right">
			<button type="submit"
					ng-disabled="formAddUsage.$invalid"
					class="btn btn-default" translate="payment.addUsage"></button>
		</div>
	</div>
</form>